<template>
	<view class="sigin-container pt-2">

		<view class="swiperBox ">
			<view class="swiper mx-3 mb-2">
				<LeftRight :data='signList' @ToDetail="getItemInfo">
					<template #bottom>
						<div class="btn flex align-center justify-center " @click="goToSign">
							<view class="text">
								去签退
							</view>
						</div>
					</template>
				</LeftRight>


			</view>
		</view>

	</view>
</template>

<script setup>
	import {
		ref,
		onMounted
	} from 'vue'
	import {
		onShow
	} from "@dcloudio/uni-app"
	import LeftRight from '../../component/commonLayout/LeftRight.vue'
	import uniReq from '../../api/index.js'

	const activityId = ref(0)
	const signList = ref([])


	const goToSign = () => {


		setTimeout(() => {
			uni.navigateTo({
				url: `/pages/signOff/signOff?id=${activityId.value}`
			})
		}, 20)

	}

	const getItemInfo = (e) => {
		console.log("e------------", e.id);
		activityId.value = e.id
	}

	const gitSignList = (status) => {
		uniReq({
			url: '/api/volunteer/activity/SelectSignOutActivity',
			method: 'GET',
			data: {
				status: status,

			}
		}, e => {
			if (e.success) {
				console.log('e-------------', e.data.records)
				signList.value = e.data.records
				signList.value.forEach((item) => {
					item.responsibleimg = JSON.parse(item.responsibleimg)
					console.log('item.responsibleimg-------------', item.responsibleimg)
				})
			} else {
				uni.showToast({
					title: '获取请假列表信息失败',
					icon: 'none'
				})
			}
		})
	}
	onShow(()=>{
		gitSignList('1,2')
		
	})
	
</script>

<style lang="scss" scoped>
	.sigin-container{
	
	}

	.swiperBox {
		width: 100%;
		// height: calc(100vh - 350rpx);
		// overflow-y: auto !important;
		box-sizing: border-box;


		.btn {
			width: 100%;
			height: 100rpx;
			padding-top: 10rpx;
			padding-bottom: 10rpx;
			box-sizing: border-box;
			border-radius: 16rpx;
			background-color: #fdeded;

			.text {
				// font-size: 28rpx;
				color: #FF0000;
				font-weight: bold;
			}

			.time {
				margin-top: 4rpx;
				font-size: 24rpx;
				color: #999;
			}
		}

		.notSigned {
			font-size: 24rpx;
			font-weight: normal;

			.red {
				color: #FE0000;
			}
		}


	}

	.swiper {
		height: 100%;

	}
</style>